package com.wxg.seata.service.impl;

import com.wxg.account.dao.mysql.mapper.AccountMapper;
import com.wxg.seata.service.AccountService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * @author void
 * @date 2021/7/7 16:37
 * @desc
 */
@Slf4j
@Service
public class AccountServiceImpl implements AccountService {
    
    @Autowired
    private AccountMapper accountMapper;

    @Override
    public void decrease(Long userId, BigDecimal money) {
        System.out.println("AccountServiceImpl.decrease 开始");

        accountMapper.decrease(userId, money);
        
        System.out.println("AccountServiceImpl.decrease 结束");
    }
}
